import uncurl
import requests


def __query_uncurl__():
    curl_command = '''
            curl 'http://10.10.80.215:9089/api/workOrder/getOneFormByNode?ins_proc_id=6379&ins_node_id=23377&procId=88&nodeId=26' \
  -H 'Accept: application/json' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H $'Cookie: \'\'; \'\'=\'\'' \
  -H 'Referer: http://10.10.80.215:9089/form-manage/proc-ins-manage/new-process/procIns-search' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36' \
  -H 'combine-token: 876eb1d3-43be-4618-8b0b-1d587162aaaf,2633f552-e99a-4e22-936e-1f23b5a06bbd' \
  --insecure
            '''

    req = uncurl.parse_context(curl_command)

    response = requests.request(
        method=req.method,
        url=req.url,
        headers=req.headers,
        data=req.data,
        verify=False
    )

    print(response.json())


def __query_requests__():
    curl_command = '''
       curl 'http://10.10.80.215:9089/api/complaint/commitTask?form_inst_id=9422&ins_proc_id=6720&ins_node_id=24704&proc_id=88&node_id=27&assignOrganize=1aaabbbcccdddeeefff0&decision=4&assignUserId=1773258056591872000' \
  -H 'Accept: application/json' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H $'Cookie: \'\'; \'\'=\'\'' \
  -H 'Origin: http://10.10.80.215:9089' \
  -H 'Referer: http://10.10.80.215:9089/form-manage/proc-ins-manage/process-manage/new-process/pendingList' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36' \
  -H 'combine-token: e0c2904c-8e35-4887-a6bc-cda959d5fd4b,e3b84881-42d2-4ff8-a670-02e8826ff6cc' \
  --data-raw '[{"formInstId":9422,"insProcId":6720,"insNodeId":24704,"itemId":"a3aa7c88-2466-452c-a632-2b73cc5afbb8","itemKey":"operationUser","seqId":0,"seqName":"操作公共字段","data":"ywcs1"},{"formInstId":9422,"insProcId":6720,"insNodeId":24704,"itemId":"c8250885-be12-4eed-86eb-0e9a9146a010","itemKey":"department","seqId":0,"seqName":"操作公共字段","data":"西藏自治区移动公司"},{"formInstId":9422,"insProcId":6720,"insNodeId":24704,"itemId":"52e840bc-5293-4166-84ad-263db8b350d5","itemKey":"telephone","seqId":0,"seqName":"操作公共字段","data":"19768903234"},{"formInstId":9422,"insProcId":6720,"insNodeId":24704,"itemId":"669bb69c-a6dc-4859-9127-eafb324b920e","itemKey":"optTime","seqId":0,"seqName":"操作公共字段","data":"2024-12-30 11:51:36"},{"formInstId":9422,"insProcId":6720,"insNodeId":24704,"itemId":"a48db96f-be78-4d99-b576-00553017562a","itemKey":"a48db96f-be78-4d99-b576-00553017562a","seqId":0,"seqName":"移交T2处理","data":"移交2"},{"insProcId":6720,"insNodeId":24704,"itemId":"showCondition","itemKey":"showCondition","seqId":0,"data":"4"}]' \
  --insecure
    '''

    req = uncurl.parse_context(curl_command)

    response = requests.request(
        method=req.method,
        url=req.url,
        headers=req.headers,
        data=req.data,
        verify=False
    )

    print(response.json())

if __name__ == '__main__':
    __query_uncurl__()